#ifndef AUDIODECODETASK_H
#define AUDIODECODETASK_H

#include <ClientImpl/Receive_handler.h>
#include <Task_Base/Task_Base.h>
#include <libavinclude.h>
class AudioDecodeTask: public Task_Base,public Receive_handler
{
public:
    AudioDecodeTask(Receive_handler*);
    ~AudioDecodeTask();
public:
    virtual int close();
    virtual bool receive_handler(char *data,int size);
protected:
    virtual int svc();//主动工作线程函数
private:
    AVCodecContext  *Dec_AvContext;

    AVCodec         *Dec_AudioCodec;

    AVFrame         *pCacheFrame;


    uint8_t         *out_buffer;

    int              out_buffer_size;

    struct SwrContext *au_convert_ctx;

    Receive_handler *m_pHandler;

    FILE* outfile;

    int m_pack_num1;
    int m_pack_num2;
};

#endif // AUDIODECODETASK_H
